<extend name="Public/base"/>

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>{$meta_title}</h2>
	</div>
	<form id="form" action="__SELF__" method="post" class="form-horizontal">
		<div class="form-item cf">
			<label class="item-label">任务标题<span class="check-tips"></span></label>
			<div class="controls">
				<input type="text" class="text input-large" name="title" value="{$info.title}">
			</div>
		</div>
		<div class="form-item cf">
			<label class="item-label">结束日期<span class="check-tips">(指派用户完成截止日期)</span></label>
			<div class="controls">
				<input type="text" class="text input-small time" name="over_time" value="{$info.over_time|time_format='Y-m-d'}">
			</div>
		</div>
		<div class="form-item cf">
			<label class="item-label">任务内容<span class="check-tips"></span></label>
			<div class="controls">
				<label class="textarea">
					<textarea name="content">{$info.content}</textarea>
					{:hook('adminArticleEdit', array('name'=>'content','value'=>$info['content']))}
				</label>
			</div>
		</div>
		<div class="form-item cf">
			<label class="item-label">任务附件<span class="check-tips">(附件可选类型:jpg,doc,docx,pdf,rar,zip)</span></label>
			<div class="controls">
				<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
				<input type="file" id="upload_file">
				<input type="hidden" name="file_id" value="{$info.file_id}"/>
				<div class="upload-img-box">
					<present name="info.file_name" value="0">
						<div class="upload-pre-file"><span class="upload_icon_all"></span>{$info.file_name}</div>
					</present>
				</div>
				<script type="text/javascript">
				//上传图片
			    /* 初始化上传插件 */
				$("#upload_file").uploadify({
			        "height"          : 30,
			        "swf"             : "__STATIC__/uploadify/uploadify.swf",
			        "fileObjName"     : "download",
			        "buttonText"      : "上传附件",
			        "uploader"        : "{:U('File/upload',array('session_id'=>session_id()))}",
			        "width"           : 120,
			        'removeTimeout'	  : 1,
			        "onUploadSuccess" : uploadFile,
			        'onFallback' : function() {
						alert('未检测到兼容版本的Flash.');
					}
			    });
				function uploadFile(file, data){
					var data = $.parseJSON(data);
			        if(data.status){
			        	var name = "file_id";
			        	$("input[name='file_id']").val(data.data);
			        	$("input[name='file_id']").parent().find('.upload-img-box').html(
			        		"<div class=\"upload-pre-file\"><span class=\"upload_icon_all\"></span>" + data.info + "</div>"
			        	);
			        } else {
			        	updateAlert(data.info);
			        	setTimeout(function(){
			                $('#top-alert').find('button').click();
			                $(that).removeClass('disabled').prop('disabled',false);
			            },1500);
			        }
			    }
				</script>
			</div>
		</div>
		<div class="form-item">
			<input type="hidden" name="id" value="{$info.id}" />
			<button type="submit" class="btn submit-btn ajax-post" target-form="form-horizontal">确 定</button>
			<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
		</div>
	</form>
</block>

<block name="script">
	<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
	<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
	<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
	<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
	<script type="text/javascript">
	    $('.time').datetimepicker({
	        format: 'yyyy-mm-dd',
	        language:"zh-CN",
	        minView:2,
	        autoclose:true
	    });
	    showTab();
		highlight_subnav("{:U('Calendar/index')}");
	</script>
</block>